package com.weiqiao.mall.service.mapper;

import com.weiqiao.mall.domain.DistributeEntity;
import com.weiqiao.mall.service.vo.DistributeVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;

import java.util.List;

@Mapper(componentModel = "spring", uses = {}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DistributeMapper {

    @Mappings({
            @Mapping(source = "company_id", target = "company_id"),
            @Mapping(source = "satisfy_next_member", target = "satisfy_next_member"),
            @Mapping(source = "satisfy_next_consumption_member", target = "satisfy_next_consumption_member"),
            @Mapping(source = "satisfy_total_commission", target = "satisfy_total_commission"),
            @Mapping(source = "satisfy_sale", target = "satisfy_sale"),
            @Mapping(source = "satisfy_order_nums", target = "satisfy_order_nums"),
            @Mapping(source = "satisfy_consumption_amount", target = "satisfy_consumption_amount"),
            @Mapping(source = "consumption_percent", target = "consumption_percent"),
            @Mapping(source = "total_commission", target = "total_commission"),
            @Mapping(source = "generalize_percent", target = "generalize_percent"),
            @Mapping(source = "percentage_percent", target = "percentage_percent"),
            @Mapping(source = "order_sign_time", target = "order_sign_time"),
            @Mapping(source = "receipt_limit", target = "receipt_limit"),
            @Mapping(source = "upgrade_standard", target = "upgrade_standard"),
            @Mapping(source = "appoint_type", target = "appoint_type")
    })
    /**
     * AddressVO转换为DistributeEntity
     *
     * @param distributeVO
     * @return
     */
    DistributeEntity toDto(DistributeVO distributeVO);

    /**
     * List<DistributeVO>转换为List<DistributeEntity>
     *
     * @param addressVO
     * @return
     */
    List<DistributeEntity> toDto(List<DistributeVO> addressVO);
}
